package pw.yitree.game.zthj;

import java.io.Serializable;
import javax.persistence.Column;
import pw.yitree.GenderConverter;
import javax.persistence.Convert;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import pw.yitree.game.FiveElement;
import pw.yitree.game.FiveElementConverter;
import pw.yitree.Gender;

@Entity
@Table(name = "zthj_role")
public class Role implements Serializable {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private int id;
    private String name;
    @ManyToOne
    @JoinColumn(name = "region_id")
    private Region region;
    @ManyToOne
    @JoinColumn(name = "account_id")
    private Account account;

    @Convert(converter = GenderConverter.class)
    private Gender gender;
    @Convert(converter = FiveElementConverter.class)
    @Column(name = "five_element")
    private FiveElement fiveElement;

    private String country;

    /**
     * @return the id
     */
    public int getId() {
        return id;
    }

    /**
     * @param id the id to set
     */
    public void setId(int id) {
        this.id = id;
    }

    /**
     * @return the name
     */
    public String getName() {
        return name;
    }

    /**
     * @param name the name to set
     */
    public void setName(String name) {
        this.name = name;
    }

    /**
     * @return the region
     */
    public Region getRegion() {
        return region;
    }

    /**
     * @param region the region to set
     */
    public void setRegion(Region region) {
        this.region = region;
    }

    /**
     * @return the account
     */
    public Account getAccount() {
        return account;
    }

    /**
     * @param account the account to set
     */
    public void setAccount(Account account) {
        this.account = account;
    }

    /**
     * @return the gender
     */
    public Gender getGender() {
        return gender;
    }

    /**
     * @param gender the gender to set
     */
    public void setGender(Gender gender) {
        this.gender = gender;
    }

    /**
     * @return the fiveElement
     */
    public FiveElement getFiveElement() {
        return fiveElement;
    }

    /**
     * @param fiveElement the fiveElement to set
     */
    public void setFiveElement(FiveElement fiveElement) {
        this.fiveElement = fiveElement;
    }

    /**
     * @return the country
     */
    public String getCountry() {
        return country;
    }

    /**
     * @param country the country to set
     */
    public void setCountry(String country) {
        this.country = country;
    }
}
